package com.woniuxy.microfixeddepositserver.dao;

import com.github.pagehelper.PageInfo;
import com.woniuxy.bean.bank.BankBean;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author: masterhai
 * @date: 2021/4/21:11:10
 * @description:
 */

public interface BankDao {
    @Select("select id bankId, bankName,bankimgSrc,singleLimit,dayLimit  from bankList where status =1 ")
    List<BankBean> selectALL ();

    @Select("select id bankId, bankName,bankimgSrc,singleLimit,dayLimit from bankList where bankName like #{bankName} and status =1")
    List<BankBean> selectALLByQuery (String bankName);

    int updateBank (BankBean bankBean);

    @Update("update bankList SET status=status + 1 where id=#{id} ")
    int deleteBank (Integer id);

    @Insert("insert bankList(bankName,bankimgSrc,singleLimit,dayLimit) " +
            "values(#{bankName},#{bankimgSrc},#{singleLimit},#{dayLimit})")
    int addBank (BankBean bankBean);

    @Select("select id bankId, bankName,bankimgSrc,singleLimit,dayLimit from bankList where id=#{id} and status =1")
    BankBean getBankById (Integer id);
}
